<?php
    
    class Model_CMS_FrontEnd{
        
        private $URL = '';
        private $dbh_w = null;
        private $dbh_r = null;
        private $h_row = null;
        private $id = 0;
        /*
         * db connection class
         */
        protected function db_connect($mode='read'){
            if ($mode == 'write'){
                if ($this->dbh_w == null){
                    $db = new DBI('write');
                    $this->dbh_w = $db->connect();
                }
                return $this->dbh_w;
            }
            
            if ($this->dbh_r == null){
                $db = new DBI('read');
                $this->dbh_r = $db->connect();
            }
            return $this->dbh_r;
        }
        
        
        
        function __construct(){
        	 global $site_global_config;        	          
           $this->URL = $site_global_config['FRONT_END_URL'];  
        }
       
       
       
       

        
    }
    
    ?>
